package com.cyufeng.blog.controller;

import com.cyufeng.blog.dto.SortDto;
import com.cyufeng.blog.service.SortService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
/**
 * 标签分类
 * @author Cyufeng
 * Data:2018.12.30
 */
@CrossOrigin
@RequestMapping("/blog/sort")
@RestController
public class SortController {
    @Autowired
    SortService sortService;

    /**
     * 得到所有的分类
     * @return List<SortDto>
     */
    @GetMapping("/getSort")
    public List<SortDto> getSort(){
        List<SortDto> sortDtoList = new ArrayList<>();
        sortDtoList = sortService.getSort();
        return sortDtoList;
    }
}
